<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>超声探头脚本管理</title>
  <!-- Tell the browser to be responsive to screen width -->
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
  <!-- Bootstrap 3.3.7 -->
  <link rel="stylesheet" href="../static/bower_components/bootstrap/dist/css/bootstrap.min.css">
  <!-- Font Awesome -->
  <link rel="stylesheet" href="../static/bower_components/font-awesome/css/font-awesome.min.css">
  <!-- Ionicons -->
  <link rel="stylesheet" href="../static/bower_components/Ionicons/css/ionicons.min.css">
  <!-- DataTables -->
  <link rel="stylesheet" href="../static/bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css">
  <!-- Theme style -->
  <link rel="stylesheet" href="../static/dist/css/AdminLTE.min.css">
  <!-- AdminLTE Skins. Choose a skin from the css/skins
       folder instead of downloading all of them to reduce the load. -->
  <link rel="stylesheet" href="../static/dist/css/skins/_all-skins.min.css">
  <!-- daterange picker -->
  <link rel="stylesheet" href="../static/bower_components/bootstrap-daterangepicker/daterangepicker.css">
  <!-- bootstrap datepicker -->
  <link rel="stylesheet" href="../static/bower_components/bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css">
  <!-- iCheck for checkboxes and radio inputs -->
  <link rel="stylesheet" href="../static/plugins/iCheck/all.css">
  <!-- Select2 -->
  <link rel="stylesheet" href="../static/bower_components/select2/dist/css/select2.min.css">
  <!-- Theme style -->
  <link rel="stylesheet" href="../static/dist/css/AdminLTE.min.css">
  <!-- AdminLTE Skins. Choose a skin from the css/skins
       folder instead of downloading all of them to reduce the load. -->
  <link rel="stylesheet" href="../static/dist/css/skins/_all-skins.min.css">

  <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
  <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
  <!--[if lt IE 9]>
  <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
  <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
  <![endif]-->

  <!-- Google Font -->
  <link rel="stylesheet"
        href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">
</head>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">

  <header class="main-header">
    <!-- Logo -->
    <a href="#" class="logo">
      <!-- mini logo for sidebar mini 50x50 pixels -->
      <span class="logo-mini">超</span>
      <!-- logo for regular state and mobile devices -->
      <span class="logo-lg">超声波成像系统平台</span>
    </a>
    <!-- Header Navbar: style can be found in header.less -->
    <nav class="navbar navbar-static-top">
      <!-- Sidebar toggle button-->
      <a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </a>

      <div class="navbar-custom-menu">
        <ul class="nav navbar-nav">
          <!--导航栏信息，已经删除-->
        </ul>
      </div>
    </nav>
  </header>
  <!-- Left side column. contains the logo and sidebar -->
  <aside class="main-sidebar">
    <!-- sidebar: style can be found in sidebar.less -->
    <section class="sidebar">
      <!-- Sidebar user panel -->
      <!-- search form -->
      <!-- /.search form -->
      <!-- sidebar menu: : style can be found in sidebar.less -->
      <ul class="sidebar-menu" data-widget="tree">

          <li><a href="${pageContext.request.contextPath}/main/medicalRecords"><i class="fa fa-circle-o"></i> 病人病历管理</a></li>
          <li><a href="${pageContext.request.contextPath}/main/medicalRecordsAnalysis"><i class="fa fa-circle-o"></i> 病人数据统计分析管理</a></li>
          <li><a href="${pageContext.request.contextPath}/main/imagingData"><i class="fa fa-circle-o"></i> 成像数据管理</a></li>
          <li><a href="${pageContext.request.contextPath}/main/projectManage"><i class="fa fa-circle-o"></i> 项目管理</a></li>
          <li><a href="${pageContext.request.contextPath}/main/commentManage"><i class="fa fa-circle-o"></i> 评价体系管理</a></li>
          <li><a href="${pageContext.request.contextPath}/main/logManage"><i class="fa fa-circle-o"></i> 平台日志信息管理</a></li>
          <li><a href="${pageContext.request.contextPath}/main/consumableMaterial"><i class="fa fa-circle-o"></i> 平台耗材管理</a></li>
          <li><a href="${pageContext.request.contextPath}/main/userManage"><i class="fa fa-circle-o"></i> 平台用户及权限管理</a></li>
          <li><a href="${pageContext.request.contextPath}/main/platformPortal"><i class="fa fa-circle-o"></i> 超声波成像系统平台门户</a></li>
          <li><a href="${pageContext.request.contextPath}/main/sendControl"><i class="fa fa-circle-o"></i> 多通道发射控制</a></li>
          <li><a href="${pageContext.request.contextPath}/main/receiveControl"><i class="fa fa-circle-o"></i> 多通道接收控制</a></li>
          <li><a href="${pageContext.request.contextPath}/main/syncControl"><i class="fa fa-circle-o"></i> 外部同步控制</a></li>
          <li><a href="${pageContext.request.contextPath}/main/dataCollect"><i class="fa fa-circle-o"></i> 数据采集与重建</a></li>
          <li><a href="${pageContext.request.contextPath}/main/waveGenerate"><i class="fa fa-circle-o"></i> 任意波束形成</a></li>
          <li><a href="${pageContext.request.contextPath}/main/scriptManage"><i class="fa fa-circle-o"></i> 超声探头脚本管理</a></li>
          <li><a href="${pageContext.request.contextPath}/main/createImgAlgorithm"><i class="fa fa-circle-o"></i> 成像模式算法</a></li>
          <li><a href="${pageContext.request.contextPath}/main/resolveImgAlgorithm"><i class="fa fa-circle-o"></i> 图像处理算法</a></li>
          <li><a href="${pageContext.request.contextPath}/main/patientManage"><i class="fa fa-circle-o"></i> 病人信息管理</a></li>
      </ul>
    </section>
    <!-- /.sidebar -->
  </aside>

  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
      <h1>
        超声探头脚本管理
        <small>详细信息</small>
      </h1>
      <ol class="breadcrumb">
        <li><a href="#"><i class="fa fa-dashboard"></i> 主页</a></li>
        <li><a href="#">超声探头脚本管理</a></li>
      </ol>
    </section>

    <!-- Main content -->
    <section class="content">
      <div class="row">
        <div class="col-xs-12">
          <div class="panel-group" id="accordion">
            <div class="panel panel-default">
              <div class="panel-heading">
                <h4 class="panel-title">
                  <a data-toggle="collapse" data-parent="#accordion"
                     href="#collapseOne">
                    凸阵探头
                  </a>
                </h4>
              </div>
              <div id="collapseOne" class="panel-collapse collapse in">
                <div class="panel-body">
                  <pre class="hierarchy bring-up">
                    <code class="language-bash" data-lang="bash">
function [ output_args ] = Untitled( input_args )


    a=importdata('xyzz2000.txt');

    [row col]=size(a);

    for i=1:row
        b(i,1) = a(i,1);
        b(i,2) = a(i,2)-1000;
        b(i,3) = a(i,3);
        b(i,4) = a(i,4);
    end

    fid = fopen('222222222222.txt','wt');
    fprintf(fid,'%d %d %d %d\n',b');
    fclose(fid);


    end
                    </code>
                  </pre>
                </div>
              </div>
            </div>
            <div class="panel panel-default">
              <div class="panel-heading">
                <h4 class="panel-title">
                  <a data-toggle="collapse" data-parent="#accordion"
                     href="#collapseTwo">
                    方阵探头
                  </a>
                </h4>
              </div>
              <div id="collapseTwo" class="panel-collapse collapse">
                <div class="panel-body">
                  <pre class="hierarchy bring-up">
                    <code class="language-bash" data-lang="bash">
                      function varargout = LBM_2D_NACA0012(varargin)
% LBM_2D_NACA0012 MATLAB code for LBM_2D_NACA0012.fig
%      LBM_2D_NACA0012, by itself, creates a new LBM_2D_NACA0012 or raises the existing
%      singleton*.
%
%      H = LBM_2D_NACA0012 returns the handle to a new LBM_2D_NACA0012 or the handle to
%      the existing singleton*.
%
%      LBM_2D_NACA0012('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in LBM_2D_NACA0012.M with the given input arguments.
%
%      LBM_2D_NACA0012('Property','Value',...) creates a new LBM_2D_NACA0012 or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before LBM_2D_NACA0012_OpeningFcn gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to LBM_2D_NACA0012_OpeningFcn via varargin.
%
%      *See GUI Options on GUIDE's Tools menu.  Choose "GUI allows only one
%      instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES

% Edit the above text to modify the response to help LBM_2D_NACA0012

% Last Modified by GUIDE v2.5 16-Jun-2017 00:32:47

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @LBM_2D_NACA0012_OpeningFcn, ...
                   'gui_OutputFcn',  @LBM_2D_NACA0012_OutputFcn, ...
                   'gui_LayoutFcn',  [] , ...
                   'gui_Callback',   []);
if nargin && ischar(varargin{1})
    gui_State.gui_Callback = str2func(varargin{1});
end

if nargout
    [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
    gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT


% --- Executes just before LBM_2D_NACA0012 is made visible.
function LBM_2D_NACA0012_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
% varargin   command line arguments to LBM_2D_NACA0012 (see VARARGIN)

% Choose default command line output for LBM_2D_NACA0012
handles.output = hObject;

% Update handles structure
guidata(hObject, handles);

% UIWAIT makes LBM_2D_NACA0012 wait for user response (see UIRESUME)
% uiwait(handles.figure1);


% --- Outputs from this function are returned to the command line.
function varargout = LBM_2D_NACA0012_OutputFcn(~, eventdata, handles)
% varargout  cell array for returning output args (see VARARGOUT);
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Get default command line output from handles structure
varargout{1} = handles.output;



function Inlet_U_Callback(hObject, eventdata, handles)
% hObject    handle to Inlet_U (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of Inlet_U as text
%        str2double(get(hObject,'String')) returns contents of Inlet_U as a double


% --- Executes during object creation, after setting all properties.
function Inlet_U_CreateFcn(hObject, eventdata, handles)
% hObject    handle to Inlet_U (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end



function Outlet_U_Callback(hObject, eventdata, handles)
% hObject    handle to Outlet_U (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of Outlet_U as text
%        str2double(get(hObject,'String')) returns contents of Outlet_U as a double


% --- Executes during object creation, after setting all properties.
function Outlet_U_CreateFcn(hObject, eventdata, handles)
% hObject    handle to Outlet_U (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end



function Re_Callback(hObject, eventdata, handles)
% hObject    handle to Re (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of Re as text
%        str2double(get(hObject,'String')) returns contents of Re as a double


% --- Executes during object creation, after setting all properties.
function Re_CreateFcn(hObject, eventdata, handles)
% hObject    handle to Re (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end



function L_Callback(hObject, eventdata, handles)
% hObject    handle to L (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of L as text
%        str2double(get(hObject,'String')) returns contents of L as a double


% --- Executes during object creation, after setting all properties.
function L_CreateFcn(hObject, eventdata, handles)
% hObject    handle to L (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


% --- Executes on button press in Start.
function Start_Callback(hObject, eventdata, handles)
% hObject    handle to Start (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
%clc
%close all
%clear all

set(handles.Start,'Enable','off');
set(handles.pause,'Enable','on');

%定义计算模型为D2Q9模型
D = 2;
Q = 9;

%定义D2Q9模型中的9个方向
e = [0,0;1,0;0,1;-1,0;0,-1;1,1;-1,1;-1,-1;1,-1];

%定义D2Q9模型中的9个方向对应的反方向编号
inv = [0, 3, 4, 1, 2, 7, 8, 5, 6];

%定义D2Q9模型标准平衡态分布函数中的9个方向权系数
w = [4.0/9,1.0/9,1.0/9,1.0/9,1.0/9,1.0/36,1.0/36,1.0/36,1.0/36];

%定义计算域的网格数
global NX;
global NY;
global style;
global grow;
global rho;
global Rho0;
global u;
global f;
global F;
global Q;
global e;
global Inlet_U;
global Outlet_U;

NX = 200;
NY = 40;

%定义计算域的密度数组
%double rho[NX+1][NY+1];
%double rho;

%定义计算域的密度数组(分别记录两次迭代步的速度值)
%double u[NX+1][NY+1][2];
%double u0[NX+1][NX+1][2];
%double u;
%double u0;

%定义计算域的分布函数数组(分别记录两次碰撞和迁移的值)
%double f[NX+1][NY+1][Q];
%double F[NX+1][NY+1][Q];
%double f;
%double F;

%定义计算域的网格类型数组
%char style[NX+1][NY+1];		%'s': 无需进行计算的网格点(即固体内部网格点)
%char style;                     %'f': 非边界的计算网格点
								%'i': 入口网格点
								%'o': 出口网格点
								%'b': 无滑移壁面网格点

%定义内部物体的个数
%NumberOfObject = 1;

%定义入口速度
Inlet_Ux = str2double(get(handles.Inlet_U,'String'));
Inlet_U = [Inlet_Ux, 0.0];

%定义出口速度
Outlet_Ux = str2double(get(handles.Outlet_U,'String'));
Outlet_U = [Outlet_Ux, 0.0];

%定义初始密度
Rho0 = 1.0;

%定义雷诺数
Re = str2double(get(handles.Re,'String'));

%定义计算的特征长度
L = str2double(get(handles.L,'String'));

%计算松弛因子
tau = 0.5 + 3.0 * ( L * Inlet_U(1) / Re );

%定义总迭代次数
Iter_Step = 100000;

%定义每隔多少步输出一次计算结果
Save_Step = 10;

%定义OpenMP的线程数
%NumOfThreads = 4;

%定义计算退出的最小速度误差
Precision = 1e-6;

bkx=[40,50,55,65,75,85,95,100,110];
bky=[0,1.5,3,3.8333,4.166667,3.8333,3,1.5,0
    0,3,6,7.6667,8.3333,7.6667,6,3,0
    0,4.5,9,11.5,12.5,11.5,9,4.5,0
    ];


 %开始计时
 t1=clock;
 grow = 2;
 %初始化
 for i = 1:NX
     for j = 1:NY
         style(i,j) = 'f';
         if  (20.03*exp(-0.6990973255e-2*(i-50)*(i-50)))./6 - j > 1
			style(i,j) = 's';
		 elseif  i == 1
			style(i,j) = 'i';
         elseif  i == NX
			style(i,j) = 'o';
         elseif ( j == 1 || j == NY )
			style(i,j) = 'b';
         end
     end
 end

 for i = 1:NX
     for j = 1:NY
         if style(i,j) == 's'
             for k = 1:Q
                 ip = i-e(k,1);
                 jp = j-e(k,2);
                 if ip > 0 && jp > 0
                    if style(ip,jp) == 'f'
                        style(ip,jp) = 'b';
                    end
                 end
             end
         end
     end
 end

for i = 1:NX
    for j = 1:NY
        rho(i,j) = Rho0;
        if style(i,j) == 'i'
            u(i,j,1) = Inlet_U(1);
            u(i,j,2) = Inlet_U(2);
        elseif style(i,j) == 'o'
            u(i,j,1) = Outlet_U(1);
            u(i,j,2) = Outlet_U(2);
        elseif style(i,j) == 'b'
            u(i,j,1) = 0;
            u(i,j,2) = 0;
        elseif style(i,j) == 's'
            u(i,j,1) = 0;
            u(i,j,2) = 0;
        elseif style(i,j) == 'f'
            u(i,j,1) = Inlet_U(1);
            u(i,j,2) = Inlet_U(2);
        end
        for k = 1:Q
            f(i,j,k) = FeqStandardD2Q9(k,rho(i,j),u(i,j,1),u(i,j,2));
            F(i,j,k) = f(i,j,k);
        end
    end
end
%初始化结束

%演化过程
for n = 1:Iter_Step

    t2=clock;
    t = etime(t2,t1);
    set(handles.time_t,'String',num2str(t));
    set(handles.tau,'String',num2str(tau));

    for i = 1:NX    %碰撞过程
        for j = 1:NY
            if style(i,j) ~= 's'
                for k = 1:Q
                    F(i,j,k) = f(i,j,k) + (FeqStandardD2Q9(k,rho(i,j),u(i,j,1),u(i,j,2))-f(i,j,k))/tau;
                end
            end
        end
    end

    for i = 1:NX    %迁移过程
        for j = 1:NY
            if style(i,j) ~= 's'
                if style(i,j) == 'i' || style(i,j) == 'o'
                    for k = 1:Q
                        f(i,j,k) = FeqStandardD2Q9(k,rho(i,j),u(i,j,1),u(i,j,2));
                    end
                elseif style(i,j) == 'f'
                    for k = 1:Q
                        ip = i - e(k,1);
                        jp = j - e(k,2);
                        f(i,j,k) = F(ip,jp,k);
                    end
                elseif style(i,j) == 'b'
                    for k = 1:Q
                        ip = i - e(k,1);
                        jp = j - e(k,2);
                        if ip>1 && ip< NX && jp>1 && jp< NY && style(ip,jp)=='f'
                                                          f(i,j,k) = F(ip,jp,k);
                                                          else
                                                          ip = i + e(k,1);
                                                          jp = j + e(k,2);
                                                          if ip>1 && ip< NX && jp>1 && jp< NY && style(ip,jp)=='f'
                                                                                            f(i,j,k) = F(ip,jp,k);
                                                                                            else
                                                                                            f(i,j,k) = F(i,j,k);
                                                                                            end
                                                                                            end
                                                                                            end
                                                                                            end
                                                                                            end
                                                                                            end
                                                                                            end

                                                                                            for i = 1:NX    %宏观量计算
                                                                                            for j = 1:NY
                                                                                            if style(i,j) ~= 's'
                                                                                            u0(i,j,1) = u(i,j,1);
                                                                                            u0(i,j,2) = u(i,j,2);
                                                                                            rho(i,j) = 0;
                                                                                            u(i,j,1) = 0;
                                                                                            u(i,j,2) = 0;
                                                                                            for k = 1:Q
                                                                                            rho(i,j) = rho(i,j) + f(i,j,k);
                                                                                            u(i,j,1) = u(i,j,1) + e(k,1)*f(i,j,k);
                                                                                            u(i,j,2) = u(i,j,2) + e(k,2)*f(i,j,k);
                                                                                            end
                                                                                            u(i,j,1) = u(i,j,1)/rho(i,j);
                                                                                            u(i,j,2) = u(i,j,2)/rho(i,j);
                                                                                            end
                                                                                            if style(i,j) == 'i'
                u(i,j,1) = Inlet_U(1);
                u(i,j,2) = Inlet_U(2);
            elseif style(i,j) == 'o'
                u(i,j,1) = Outlet_U(1);
                u(i,j,2) = Outlet_U(2);
            elseif style(i,j) == 'b'
                u(i,j,1) = 0;
                u(i,j,2) = 0;
            end
        end
    end
    %宏观量计算结束

    if mod(n,Save_Step) == 0
        for j = 1:NY
            for i = 1:NX
                if style(i,j) == 's'
                    result((j-1)*NX+i,1) = i;
                    result((j-1)*NX+i,2) = j;
                    result((j-1)*NX+i,3) = 0;
                    result((j-1)*NX+i,4) = 0;
                else
                    result((j-1)*NX+i,1) = i;
                    result((j-1)*NX+i,2) = j;
                    result((j-1)*NX+i,3) = u(i,j,1);
                    result((j-1)*NX+i,4) = u(i,j,2);
                end
            end
        end


        temp1 = 0;
        temp2 = 0;
        for i = 1:NX
            for j = 1:NY
                if style(i,j) ~= 's'
                    temp1 = temp1 + (u(i,j,1)-u0(i,j,1))*(u(i,j,1)-u0(i,j,1)) + (u(i,j,2)-u0(i,j,2))*(u(i,j,2)-u0(i,j,2));
                    temp2 = temp2 + u(i,j,1)*u(i,j,1) + u(i,j,2)*u(i,j,2);
                end
            end
        end
        temp1 = sqrt(temp1);
        temp2 = sqrt(temp2);
        error = temp1/(temp2 + 1e-30);

        if error < Precision
            break;
        end

        %fp = fopen('F:\w123.dat','w');
        %for ii = 1:NX*NY
        %    fprintf(fp,'%g ',result(ii,1));
        %    fprintf(fp,'%g ',result(ii,2));
        %    fprintf(fp,'%g ',result(ii,3));
        %    fprintf(fp,'%g\n',result(ii,4));
        %end
        %fclose(fp);

        t2=clock;
        t = etime(t2,t1);
        xxx=1:0.2:NX;
        yyy=(20.03.*exp(-0.6990973255e-2.*(xxx-50).*(xxx-50))).*(grow-1)./6;

        set(handles.time_t,'String',num2str(t));
        set(handles.tau,'String',num2str(tau));
        set(handles.error,'String',num2str(error));
        set(handles.n,'String',num2str(n));
        uv=sqrt(result(:,3).*result(:,3)+result(:,4).*result(:,4));
        [xx,yy] = meshgrid(linspace(1,NX,NX),linspace(1,NY,NY));
        uu = griddata(result(:,1),result(:,2),result(:,3),xx,yy);
        vv = griddata(result(:,1),result(:,2),result(:,4),xx,yy);
        [X,Y,Z]=griddata(result(:,1),result(:,2),uv,xx,yy);
        cla(handles.axes1)
        %axes(handles.axes1);
        hold on
        plot(handles.axes1,xxx,yyy,'color','r')
        streamslice(handles.axes1,xx,yy,uu,vv)
        %plot(handles.axes1,xxx,yyy,'color','r')
        axis(handles.axes1,[1 NX 1 NY])
        cla(handles.axes2)
        f1=pcolor(handles.axes2,X,Y,Z);
        plot(handles.axes2,xxx,yyy,'color','r')
        set(f1,'LineStyle','none')
        axis(handles.axes2,[1 NX 1 NY])
        colorbar;
        hold off
        drawnow;
    end

end
%演化结束




% --- Executes on button press in pause.
function pause_Callback(hObject, eventdata, handles)
% hObject    handle to pause (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
set(handles.flag11,'String','1');
flag1 = str2num(get(handles.flag11,'String'));
set(handles.pause,'Enable','off');
set(handles.goon,'Enable','on')
get(handles.flag11,'String')
while ( flag1 == 1 )
    pause(0.5);
    flag1 = str2num(get(handles.flag11,'String'));
    pause(0.5);
end



% --- Executes on button press in goon.
function goon_Callback(hObject, eventdata, handles)
% hObject    handle to goon (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
set(handles.pause,'Enable','on');
set(handles.goon,'Enable','off');
set(handles.flag11,'String','0');
get(handles.flag11,'String')


% --- Executes on button press in grow.
function grow_Callback(hObject, eventdata, handles)
% hObject    handle to grow (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
global NX;
global NY;
global style;
global grow;
global rho;
global Rho0;
global u;
global f;
global F;
global Q;
global e;
global Inlet_U;
global Outlet_U;

for iz = 1:NX
     for jz = 1:NY
         style(iz,jz) = 'f';
         if  (20.03*exp(-0.6990973255e-2*(iz-50)*(iz-50))).*grow./6 - jz > 1
			style(iz,jz) = 's';
		 elseif  iz == 1
			style(iz,jz) = 'i';
         elseif  iz == NX
			style(iz,jz) = 'o';
         elseif ( jz == 1 || jz == NY )
			style(iz,jz) = 'b';
         end
     end
end

for i = 1:NX
     for j = 1:NY
         if style(i,j) == 's'
             for k = 1:Q
                 ip = i-e(k,1);
                 jp = j-e(k,2);
                 if ip > 0 && jp > 0
                    if style(ip,jp) == 'f'
                        style(ip,jp) = 'b';
                    end
                 end
             end
         end
     end
 end

for i = 1:NX
    for j = 1:NY
        rho(i,j) = Rho0;
        if style(i,j) == 'i'
            u(i,j,1) = Inlet_U(1);
            u(i,j,2) = Inlet_U(2);
        elseif style(i,j) == 'o'
            u(i,j,1) = Outlet_U(1);
            u(i,j,2) = Outlet_U(2);
        elseif style(i,j) == 'b'
            u(i,j,1) = 0;
            u(i,j,2) = 0;
        elseif style(i,j) == 's'
            u(i,j,1) = 0;
            u(i,j,2) = 0;
        end
        for k = 1:Q
            f(i,j,k) = FeqStandardD2Q9(k,rho(i,j),u(i,j,1),u(i,j,2));
            F(i,j,k) = f(i,j,k);
        end
    end
end


grow = grow + 1;
if grow == 7
    set(handles.grow,'Enable','off');
end
                    </code>
                  </pre>
                </div>
              </div>
            </div>
            <div class="panel panel-default">
              <div class="panel-heading">
                <h4 class="panel-title">
                  <a data-toggle="collapse" data-parent="#accordion"
                     href="#collapseThree">
                    机械臂扫探头
                  </a>
                </h4>
              </div>
              <div id="collapseThree" class="panel-collapse collapse">
                <div class="panel-body">
                  <pre class="hierarchy bring-up">
                    <code class="language-bash" data-lang="bash">
                      function varargout = first(varargin)
% FIRST MATLAB code for first.fig
%      FIRST, by itself, creates a new FIRST or raises the existing
%      singleton*.
%
%      H = FIRST returns the handle to a new FIRST or the handle to
%      the existing singleton*.
%
%      FIRST('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in FIRST.M with the given input arguments.
%
%      FIRST('Property','Value',...) creates a new FIRST or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before first_OpeningFcn gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to first_OpeningFcn via varargin.
%
%      *See GUI Options on GUIDE's Tools menu.  Choose "GUI allows only one
%      instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES

% Edit the above text to modify the response to help first

% Last Modified by GUIDE v2.5 10-May-2017 23:00:34

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @first_OpeningFcn, ...
                   'gui_OutputFcn',  @first_OutputFcn, ...
                   'gui_LayoutFcn',  [] , ...
                   'gui_Callback',   []);
if nargin && ischar(varargin{1})
    gui_State.gui_Callback = str2func(varargin{1});
end

if nargout
    [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
    gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT


% --- Executes just before first is made visible.
function first_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
% varargin   command line arguments to first (see VARARGIN)

% Choose default command line output for first
handles.output = hObject;

% Update handles structure
guidata(hObject, handles);

% UIWAIT makes first wait for user response (see UIRESUME)
% uiwait(handles.figure1);


% --- Outputs from this function are returned to the command line.
function varargout = first_OutputFcn(hObject, eventdata, handles)
% varargout  cell array for returning output args (see VARARGOUT);
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Get default command line output from handles structure
varargout{1} = handles.output;



function edit1_Callback(hObject, eventdata, handles)
% hObject    handle to edit1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of edit1 as text
%        str2double(get(hObject,'String')) returns contents of edit1 as a double


% --- Executes during object creation, after setting all properties.
function edit1_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end



function edit2_Callback(hObject, eventdata, handles)
% hObject    handle to edit2 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of edit2 as text
%        str2double(get(hObject,'String')) returns contents of edit2 as a double


% --- Executes during object creation, after setting all properties.
function edit2_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit2 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


% --- Executes on button press in huitu.
function huitu_Callback(hObject, eventdata, handles)
% hObject    handle to huitu (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
fd=get(handles.edit5,'String')
%axes(handles.axes3)
xmin=str2num(get(handles.edit2,'String'));
xmax=str2num(get(handles.edit3,'String'));
ezplot(handles.axes3,fd,[xmin xmax xmin xmax]);
grid on;
% str = num2str(x+y);
% set(handles.edit4,'String',str);

% xx=1:0.1:5;
% yy=xx^2;
% f1=plot(xx,yy)


function edit3_Callback(hObject, eventdata, handles)
% hObject    handle to edit3 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of edit3 as text
%        str2double(get(hObject,'String')) returns contents of edit3 as a double


% --- Executes during object creation, after setting all properties.
function edit3_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit3 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end



function edit4_Callback(hObject, eventdata, handles)
% hObject    handle to edit4 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of edit4 as text
%        str2double(get(hObject,'String')) returns contents of edit4 as a double


% --- Executes during object creation, after setting all properties.
function edit4_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit4 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end



function edit5_Callback(hObject, eventdata, handles)
% hObject    handle to edit5 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of edit5 as text
%        str2double(get(hObject,'String')) returns contents of edit5 as a double


% --- Executes during object creation, after setting all properties.
function edit5_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit5 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


% --------------------------------------------------------------------
function Untitled_1_Callback(hObject, eventdata, handles)
% hObject    handle to Untitled_1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --------------------------------------------------------------------
function Untitled_3_Callback(hObject, eventdata, handles)
% hObject    handle to Untitled_3 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --------------------------------------------------------------------
function Untitled_2_Callback(hObject, eventdata, handles)
% hObject    handle to Untitled_2 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

                    </code>
                  </pre>
                </div>
              </div>
            </div>
            <div class="panel panel-default">
              <div class="panel-heading">
                <h4 class="panel-title">
                  <a data-toggle="collapse" data-parent="#accordion"
                     href="#collapseFour">
                    相控阵探头
                  </a>
                </h4>
              </div>
              <div id="collapseFour" class="panel-collapse collapse">
                <div class="panel-body">
                  <pre class="hierarchy bring-up">
                    <code class="language-bash" data-lang="bash">
                      function feq = FeqStandardD2Q9(k,rho,u1,u2)

e = [0,0;1,0;0,1;-1,0;0,-1;1,1;-1,1;-1,-1;1,-1];
w = [4.0/9,1.0/9,1.0/9,1.0/9,1.0/9,1.0/36,1.0/36,1.0/36,1.0/36];

eu = e(k,1)*u1+e(k,2)*u2;
uv = u1*u1+u2*u2;
feq = w(k)*rho*(1+3*eu+4.5*eu*eu-1.5*uv);

end
                    </code>
                  </pre>
                </div>
              </div>
            </div>
            <div class="panel panel-default">
              <div class="panel-heading">
                <h4 class="panel-title">
                  <a data-toggle="collapse" data-parent="#accordion"
                     href="#collapseFive">
                    穿刺探头
                  </a>
                </h4>
              </div>
              <div id="collapseFive" class="panel-collapse collapse">
                <div class="panel-body">
                  <pre class="hierarchy bring-up">
                    <code class="language-bash" data-lang="bash">
                      clc
close all
clear all

%定义计算模型为D2Q9模型
D = 2;
Q = 9;

%定义D2Q9模型中的9个方向
e = [0,0;1,0;0,1;-1,0;0,-1;1,1;-1,1;-1,-1;1,-1];

%定义D2Q9模型中的9个方向对应的反方向编号
inv = [0, 3, 4, 1, 2, 7, 8, 5, 6];

%定义D2Q9模型标准平衡态分布函数中的9个方向权系数
w = [4.0/9,1.0/9,1.0/9,1.0/9,1.0/9,1.0/36,1.0/36,1.0/36,1.0/36];

%定义计算域的网格数
NX = 200;
NY = 40;

%定义计算域的密度数组
%double rho[NX+1][NY+1];
%double rho;

%定义计算域的密度数组(分别记录两次迭代步的速度值)
%double u[NX+1][NY+1][2];
%double u0[NX+1][NX+1][2];
%double u;
%double u0;

%定义计算域的分布函数数组(分别记录两次碰撞和迁移的值)
%double f[NX+1][NY+1][Q];
%double F[NX+1][NY+1][Q];
%double f;
%double F;

%定义计算域的网格类型数组
%char style[NX+1][NY+1];		%'s': 无需进行计算的网格点(即固体内部网格点)
%char style;                     %'f': 非边界的计算网格点
								%'i': 入口网格点
								%'o': 出口网格点
								%'b': 无滑移壁面网格点

%定义内部物体的个数
NumberOfObject = 1;

%定义入口速度
Inlet_U = [0.1, 0.0];

%定义出口速度
Outlet_U = [0.1, 0.0];

%定义初始密度
Rho0 = 1.0;

%定义雷诺数
Re = 50;

%定义计算的特征长度
L = 10;

%计算松弛因子
tau = 0.5 + 3.0 * ( L * Inlet_U(1) / Re );

%定义总迭代次数
Iter_Step = 100000;

%定义每隔多少步输出一次计算结果
Save_Step = 10;

%定义OpenMP的线程数
NumOfThreads = 4;

%定义计算退出的最小速度误差
Precision = 1e-6;


 %开始计时
 t1=clock;

 %初始化
 for i = 1:NX
     for j = 1:NY
         style(i,j) = 'f';
         if  20.03*exp(-0.6990973255e-2*(i-50)*(i-50)) - j > 1
			style(i,j) = 's';
		 elseif  i == 1
			style(i,j) = 'i';
         elseif  i == NX
			style(i,j) = 'o';
         elseif ( j == 1 || j == NY )
			style(i,j) = 'b';
         end
     end
 end

 for i = 1:NX
     for j = 1:NY
         if style(i,j) == 's'
             for k = 1:Q
                 ip = i-e(k,1);
                 jp = j-e(k,2);
                 if ip > 0 & jp > 0
                    if style(ip,jp) == 'f'
                        style(ip,jp) = 'b';
                    end
                 end
             end
         end
     end
 end

for i = 1:NX
    for j = 1:NY
        rho(i,j) = Rho0;
        if style(i,j) == 'i'
            u(i,j,1) = Inlet_U(1);
            u(i,j,2) = Inlet_U(2);
        elseif style(i,j) == 'o'
            u(i,j,1) = Outlet_U(1);
            u(i,j,2) = Outlet_U(2);
        elseif style(i,j) == 'b'
            u(i,j,1) = 0;
            u(i,j,2) = 0;
        elseif style(i,j) == 's'
            u(i,j,1) = 0;
            u(i,j,2) = 0;
        elseif style(i,j) == 'f'
            u(i,j,1) = Inlet_U(1);
            u(i,j,2) = Inlet_U(2);
        end
        for k = 1:Q
            f(i,j,k) = FeqStandardD2Q9(k,rho(i,j),u(i,j,1),u(i,j,2));
            F(i,j,k) = f(i,j,k);
        end
    end
end
%初始化结束

%演化过程
for n = 1:Iter_Step
    for i = 1:NX    %碰撞过程
        for j = 1:NY
            if style(i,j) ~= 's'
                for k = 1:Q
                    F(i,j,k) = f(i,j,k) + (FeqStandardD2Q9(k,rho(i,j),u(i,j,1),u(i,j,2))-f(i,j,k))/tau;
                end
            end
        end
    end

    for i = 1:NX    %迁移过程
        for j = 1:NY
            if style(i,j) ~= 's'
                if style(i,j) == 'i' || style(i,j) == 'o'
                    for k = 1:Q
                        f(i,j,k) = FeqStandardD2Q9(k,rho(i,j),u(i,j,1),u(i,j,2));
                    end
                elseif style(i,j) == 'f'
                    for k = 1:Q
                        ip = i - e(k,1);
                        jp = j - e(k,2);
                        f(i,j,k) = F(ip,jp,k);
                    end
                elseif style(i,j) == 'b'
                    for k = 1:Q
                        ip = i - e(k,1);
                        jp = j - e(k,2);
                        if ip>1 & ip< NX & jp>1 & jp< NY & style(ip,jp)=='f'
                                                       f(i,j,k) = F(ip,jp,k);
                                                       else
                                                       ip = i + e(k,1);
                                                       jp = j + e(k,2);
                                                       if ip>1 & ip< NX & jp>1 & jp< NY & style(ip,jp)=='f'
                                                                                      f(i,j,k) = F(ip,jp,k);
                                                                                      else
                                                                                      f(i,j,k) = F(i,j,k);
                                                                                      end
                                                                                      end
                                                                                      end
                                                                                      end
                                                                                      end
                                                                                      end
                                                                                      end

                                                                                      for i = 1:NX    %宏观量计算
                                                                                      for j = 1:NY
                                                                                      if style(i,j) ~= 's'
                                                                                      u0(i,j,1) = u(i,j,1);
                                                                                      u0(i,j,2) = u(i,j,2);
                                                                                      rho(i,j) = 0;
                                                                                      u(i,j,1) = 0;
                                                                                      u(i,j,2) = 0;
                                                                                      for k = 1:Q
                                                                                      rho(i,j) = rho(i,j) + f(i,j,k);
                                                                                      u(i,j,1) = u(i,j,1) + e(k,1)*f(i,j,k);
                                                                                      u(i,j,2) = u(i,j,2) + e(k,2)*f(i,j,k);
                                                                                      end
                                                                                      u(i,j,1) = u(i,j,1)/rho(i,j);
                                                                                      u(i,j,2) = u(i,j,2)/rho(i,j);
                                                                                      end
                                                                                      if style(i,j) == 'i'
                u(i,j,1) = Inlet_U(1);
                u(i,j,2) = Inlet_U(2);
            elseif style(i,j) == 'o'
                u(i,j,1) = Outlet_U(1);
                u(i,j,2) = Outlet_U(2);
            elseif style(i,j) == 'b'
                u(i,j,1) = 0;
                u(i,j,2) = 0;
            end
        end
    end

    temp1 = 0;
    temp2 = 0;
    for i = 1:NX
        for j = 1:NY
            if style(i,j) ~= 's'
                temp1 = temp1 + (u(i,j,1)-u0(i,j,1))*(u(i,j,1)-u0(i,j,1)) + (u(i,j,2)-u0(i,j,2))*(u(i,j,2)-u0(i,j,2));
                temp2 = temp2 + u(i,j,1)*u(i,j,1) + u(i,j,2)*u(i,j,2);
            end
        end
    end
    temp1 = sqrt(temp1);
    temp2 = sqrt(temp2);
    error = temp1/(temp2 + 1e-30);

    if error < Precision
        break;
    end

    if mod(n,Save_Step) == 0
        for j = 1:NY
            for i = 1:NX
                if style(i,j) == 's'
                    result((j-1)*NX+i,1) = i;
                    result((j-1)*NX+i,2) = j;
                    result((j-1)*NX+i,3) = 0;
                    result((j-1)*NX+i,4) = 0;
                else
                    result((j-1)*NX+i,1) = i;
                    result((j-1)*NX+i,2) = j;
                    result((j-1)*NX+i,3) = u(i,j,1);
                    result((j-1)*NX+i,4) = u(i,j,2);
                end
            end
        end
        fp = fopen('F:\w123.dat','w');
        for ii = 1:NX*NY
            fprintf(fp,'%g ',result(ii,1));
            fprintf(fp,'%g ',result(ii,2));
            fprintf(fp,'%g ',result(ii,3));
            fprintf(fp,'%g\n',result(ii,4));
        end
        fclose(fp);
        if NX > NY
            ax = NX;
        else
            ax = NY;
        end
        [xx yy] = meshgrid(linspace(1,NX,NX),linspace(1,NY,NY));
        uu = griddata(result(:,1),result(:,2),result(:,3),xx,yy);
        vv = griddata(result(:,1),result(:,2),result(:,4),xx,yy);
        n
        %pause;
        cla;
        streamslice(xx,yy,uu,vv)
        axis([0 ax 0 ax])
        drawnow;
    end

end
%演化结束

for j = 1:NY
    for i = 1:NX
        if style(i,j) == 's'
            result((j-1)*NX+i,1) = i;
            result((j-1)*NX+i,2) = j;
            result((j-1)*NX+i,3) = 0;
            result((j-1)*NX+i,4) = 0;
        else
            result((j-1)*NX+i,1) = i;
            result((j-1)*NX+i,2) = j;
            result((j-1)*NX+i,3) = u(i,j,1);
            result((j-1)*NX+i,4) = u(i,j,2);
        end
    end
end

fp = fopen('E:\w123.dat','w');

for ii = 1:NX*NY
    fprintf(fp,'%g ',result(ii,1));
    fprintf(fp,'%g ',result(ii,2));
    fprintf(fp,'%g ',result(ii,3));
    fprintf(fp,'%g\n',result(ii,4));
end

t2=clock;
t = etime(t2,t1)
n
error


                    </code>
                  </pre>
                </div>
              </div>
            </div>
            <div class="panel panel-default">
              <div class="panel-heading">
                <h4 class="panel-title">
                  <a data-toggle="collapse" data-parent="#accordion"
                     href="#collapseSix">
                    线扫探头
                  </a>
                </h4>
              </div>
              <div id="collapseSix" class="panel-collapse collapse">
                <div class="panel-body">
                  <pre class="hierarchy bring-up">
                    <code class="language-bash" data-lang="bash">
                      function [outputArg1,outputArg2] = untitled(inputArg1,inputArg2)

x=[0, 1,-1, 0, 0, 0, 0, 1,-1, 1,-1, 1,-1, 1,-1, 0, 0, 0, 0];
y=[0, 0, 0, 1,-1, 0, 0, 1,-1,-1, 1, 0, 0, 0, 0, 1,-1, 1,-1];
z=[0, 0, 0, 0, 0, 1,-1, 0, 0, 0, 0, 1,-1,-1, 1, 1,-1,-1, 1];

hold on

a=[0 0];
b=[1 1];
c=[-1 -1];
d=[-1 1];

e=[0.5 0.5];
f=[-0.5 -0.5];


line(d, a ,b)
line(d, b ,b)
line(d, b ,c)
line(d, b ,a)
line( a ,d,b)
line(d, c ,b)
line( b ,d,b)
line( b ,d,c)
line( b ,d,a)
line( c ,d,b)
line( a ,b,d)
line( b ,b,d)
line( b ,c,d)
line( b ,a,d)
line( c ,b,d)


% line(d, e ,b)
% line(d, f ,b)
% line(d, b ,e)
% line(d, b ,f)
% line(b, d ,f)
% line(b, d ,e)
% line(f, d ,b)
% line(e, d ,b)
% line(b, f ,d)
% line(f, b ,d)
% line(b, e ,d)
% line(e, b ,d)



line(d, c ,a)
line(d, c ,c)
line(d, a ,c)
line(d, a ,a)
line( a ,d,a)
line( a ,c,d)
line( a ,d,c)
line( c ,c,d)
line( c ,d,c)
line( c ,a,d)
line( c ,d,a)
line( a ,a,d)
plot3(x,y,z,'*','color','r')
for i=1:19
    num = num2str(i-1);
    num2 = [' ',num];
    set(text(x(i),y(i),z(i),num2),'FontName','Times New Roman','FontSize',20)
end
axis off



end


                    </code>
                  </pre>
                </div>
              </div>
            </div>
            <div class="panel panel-default">
              <div class="panel-heading">
                <h4 class="panel-title">
                  <a data-toggle="collapse" data-parent="#accordion"
                     href="#collapseSeven">
                    腔内探头
                  </a>
                </h4>
              </div>
              <div id="collapseSeven" class="panel-collapse collapse">
                <div class="panel-body">
                  <pre class="hierarchy bring-up">
                    <code class="language-bash" data-lang="bash">
                      function [ output_args ] = Untitled2( input_args )

x = [65	130	260	520	1040	2080	4160	8320	16640	33280	66560	133120];
y1 = [28.11503	56.13363557	110.8411301	220.1645296	437.9094365	864.8612795	1699.361007	3302.467944	6401.065541	12355.74669	23578.08509	44402.5252];
y2 = [43.25389231	43.17971967	42.63120387	42.33933261	42.10667659	41.57986921	40.85002422	39.69312433	38.46794195	37.12664269	35.42380572	33.35526232];

% x = [1	2	4	8	16	32	64	128	256	512	1024	2048];
% y1 = [1	1.99657036	3.9424155	7.830848112	15.57563469	30.76152789	60.44315113	117.4627217	227.6741494	439.4712255	838.629199	1488.759174];
% y2 = [100	99.828518	98.5603875	97.8856014	97.3477168	96.12977466	94.44242364	91.76775131	88.93521462	85.83422372	81.89738271	77.115];

hold on;
h0 = plot(x,x,'k');
[ax,h1,h2]=plotyy(x,y1,x,y2);
set(get(ax(1),'Ylabel'),'string','Speedup');
set(get(ax(2),'Ylabel'),'string','Parallel efficiency');
% xlabel('Number of CGs(each CG includes 1 MPE and 64 CPEs)');
xlabel('Number of cores');
h1.Marker = 's';
h2.Marker = 'o';
h1.Color = 'b';
h2.Color = 'r';

% set(ax(1),'Xlim',[0,2200]);
% set(ax(2),'Xlim',[0,2200]);
% set(ax(1),'Ylim',[0,2200]);
% set(ax(1),'yTick',[0:220:2200]);

set(ax(1),'Xlim',[0,140000]);
set(ax(2),'Xlim',[0,140000]);
set(ax(1),'XTick',[0:10000:140000]);
set(ax(1),'Ylim',[0,140000]);
set(ax(1),'yTick',[0:14000:140000]);

set(ax(2),'Ylim',[0,100]) ;
set(ax(2),'yTick',[0:10:100]);
legend('Ideal speedup value','Speedup','Parallel efficiency','location','NorthWest'); % NorthWest SouthEast
grid on

end
                    </code>
                  </pre>
                </div>
              </div>
            </div>

          </div>
        </div>

      </div>
    </section>
    <!-- /.content -->
  </div>
  <!-- /.content-wrapper -->
  <footer class="main-footer">
    <div class="pull-right hidden-xs">
      <b>Version</b> 1.0.0
    </div>
    <strong>Copyright &copy; 2018 <a href="#">上海大学 </a>.</strong> All rights
    reserved.
  </footer>

  <!-- Control Sidebar -->
  <aside class="control-sidebar control-sidebar-dark">
    <!-- Create the tabs -->
    <ul class="nav nav-tabs nav-justified control-sidebar-tabs">
      <li><a href="#control-sidebar-home-tab" data-toggle="tab"><i class="fa fa-home"></i></a></li>
      <li><a href="#control-sidebar-settings-tab" data-toggle="tab"><i class="fa fa-gears"></i></a></li>
    </ul>
    <!-- Tab panes -->
    <div class="tab-content">
      <!-- Home tab content -->
      <div class="tab-pane" id="control-sidebar-home-tab">
        <h3 class="control-sidebar-heading">Recent Activity</h3>
        <ul class="control-sidebar-menu">
          <li>
            <a href="javascript:void(0)">
              <i class="menu-icon fa fa-birthday-cake bg-red"></i>

              <div class="menu-info">
                <h4 class="control-sidebar-subheading">Langdon's Birthday</h4>

                <p>Will be 23 on April 24th</p>
              </div>
            </a>
          </li>
          <li>
            <a href="javascript:void(0)">
              <i class="menu-icon fa fa-user bg-yellow"></i>

              <div class="menu-info">
                <h4 class="control-sidebar-subheading">Frodo Updated His Profile</h4>

                <p>New phone +1(800)555-1234</p>
              </div>
            </a>
          </li>
          <li>
            <a href="javascript:void(0)">
              <i class="menu-icon fa fa-envelope-o bg-light-blue"></i>

              <div class="menu-info">
                <h4 class="control-sidebar-subheading">Nora Joined Mailing List</h4>

                <p>nora@example.com</p>
              </div>
            </a>
          </li>
          <li>
            <a href="javascript:void(0)">
              <i class="menu-icon fa fa-file-code-o bg-green"></i>

              <div class="menu-info">
                <h4 class="control-sidebar-subheading">Cron Job 254 Executed</h4>

                <p>Execution time 5 seconds</p>
              </div>
            </a>
          </li>
        </ul>
        <!-- /.control-sidebar-menu -->

        <h3 class="control-sidebar-heading">Tasks Progress</h3>
        <ul class="control-sidebar-menu">
          <li>
            <a href="javascript:void(0)">
              <h4 class="control-sidebar-subheading">
                Custom Template Design
                <span class="label label-danger pull-right">70%</span>
              </h4>

              <div class="progress progress-xxs">
                <div class="progress-bar progress-bar-danger" style="width: 70%"></div>
              </div>
            </a>
          </li>
          <li>
            <a href="javascript:void(0)">
              <h4 class="control-sidebar-subheading">
                Update Resume
                <span class="label label-success pull-right">95%</span>
              </h4>

              <div class="progress progress-xxs">
                <div class="progress-bar progress-bar-success" style="width: 95%"></div>
              </div>
            </a>
          </li>
          <li>
            <a href="javascript:void(0)">
              <h4 class="control-sidebar-subheading">
                Laravel Integration
                <span class="label label-warning pull-right">50%</span>
              </h4>

              <div class="progress progress-xxs">
                <div class="progress-bar progress-bar-warning" style="width: 50%"></div>
              </div>
            </a>
          </li>
          <li>
            <a href="javascript:void(0)">
              <h4 class="control-sidebar-subheading">
                Back End Framework
                <span class="label label-primary pull-right">68%</span>
              </h4>

              <div class="progress progress-xxs">
                <div class="progress-bar progress-bar-primary" style="width: 68%"></div>
              </div>
            </a>
          </li>
        </ul>
        <!-- /.control-sidebar-menu -->

      </div>
      <!-- /.tab-pane -->
      <!-- Stats tab content -->
      <div class="tab-pane" id="control-sidebar-stats-tab">Stats Tab Content</div>
      <!-- /.tab-pane -->
      <!-- Settings tab content -->
      <div class="tab-pane" id="control-sidebar-settings-tab">
        <form method="post">
          <h3 class="control-sidebar-heading">General Settings</h3>

          <div class="form-group">
            <label class="control-sidebar-subheading">
              Report panel usage
              <input type="checkbox" class="pull-right" checked>
            </label>

            <p>
              Some information about this general settings option
            </p>
          </div>
          <!-- /.form-group -->

          <div class="form-group">
            <label class="control-sidebar-subheading">
              Allow mail redirect
              <input type="checkbox" class="pull-right" checked>
            </label>

            <p>
              Other sets of options are available
            </p>
          </div>
          <!-- /.form-group -->

          <div class="form-group">
            <label class="control-sidebar-subheading">
              Expose author name in posts
              <input type="checkbox" class="pull-right" checked>
            </label>

            <p>
              Allow the user to show his name in blog posts
            </p>
          </div>
          <!-- /.form-group -->

          <h3 class="control-sidebar-heading">Chat Settings</h3>

          <div class="form-group">
            <label class="control-sidebar-subheading">
              Show me as online
              <input type="checkbox" class="pull-right" checked>
            </label>
          </div>
          <!-- /.form-group -->

          <div class="form-group">
            <label class="control-sidebar-subheading">
              Turn off notifications
              <input type="checkbox" class="pull-right">
            </label>
          </div>
          <!-- /.form-group -->

          <div class="form-group">
            <label class="control-sidebar-subheading">
              Delete chat history
              <a href="javascript:void(0)" class="text-red pull-right"><i class="fa fa-trash-o"></i></a>
            </label>
          </div>
          <!-- /.form-group -->
        </form>
      </div>
      <!-- /.tab-pane -->
    </div>
  </aside>
  <!-- /.control-sidebar -->
  <!-- Add the sidebar's background. This div must be placed
       immediately after the control sidebar -->
  <div class="control-sidebar-bg"></div>
</div>
<!-- ./wrapper -->

<!-- jQuery 3 -->
<script src="../static/bower_components/jquery/dist/jquery.min.js"></script>
<!-- Bootstrap 3.3.7 -->
<script src="../static/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
<!-- DataTables -->
<script src="../static/bower_components/datatables.net/js/jquery.dataTables.min.js"></script>
<script src="../static/bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js"></script>
<!-- SlimScroll -->
<script src="../static/bower_components/jquery-slimscroll/jquery.slimscroll.min.js"></script>
<!-- FastClick -->
<script src="../static/bower_components/fastclick/lib/fastclick.js"></script>
<!-- AdminLTE App -->
<script src="../static/dist/js/adminlte.min.js"></script>
<!-- AdminLTE for demo purposes -->
<script src="../static/dist/js/demo.js"></script>
<!-- page script -->
<!-- Select2 -->
<script src="../static/bower_components/select2/dist/js/select2.full.min.js"></script>
<!-- InputMask -->
<script src="../static/plugins/input-mask/jquery.inputmask.js"></script>
<script src="../static/plugins/input-mask/jquery.inputmask.date.extensions.js"></script>
<script src="../static/plugins/input-mask/jquery.inputmask.extensions.js"></script>
<!-- date-range-picker -->
<script src="../static/bower_components/moment/min/moment.min.js"></script>
<script src="../static/bower_components/bootstrap-daterangepicker/daterangepicker.js"></script>
<!-- bootstrap datepicker -->
<script src="../static/bower_components/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js"></script>
<!-- bootstrap color picker -->
<script src="../static/bower_components/bootstrap-colorpicker/dist/js/bootstrap-colorpicker.min.js"></script>
<!-- bootstrap time picker -->
<script src="../static/plugins/timepicker/bootstrap-timepicker.min.js"></script>
<!-- iCheck 1.0.1 -->
<script src="../static/plugins/iCheck/icheck.min.js"></script>
<!-- ChartJS -->
<script src="../static/bower_components/chart.js/Chart.js"></script>

<!--echarts插件加载-->
<script src="../static/plugins/echarts/echarts.js"></script>

</body>
</html>
